package com.example.webservice.NoCxfWsdl;

import com.alibaba.fastjson.JSONObject;
import org.jdom2.input.SAXBuilder;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;

public class wsdlReturn {
    public static void main(String[] args) throws Exception {
//        返回报文解析
        doXMLParse("<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
                "   <s:Body>\n" +
                "   <QualityTrackBillResponse xmlns=\"http://tempuri.org/\">\n" +
                "   <QualityTrackBillResult i:nil=\"true\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SIE.PMS.Service\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"/>\n" +
                "   <QTB_OUT_PARAM xmlns:a=\"http://schemas.datacontract.org/2004/07/SIE.PMS.Service.SAP.QualityTrackBills.OutParams\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">\n" +
                "   <a:QTB_OUT_PARAM><a:PROCESS_CAPTCHA xmlns:b=\"http://schemas.datacontract.org/2004/07/SIE.PMS.Service.SAP.Processes.OutParams.Processes\"><b:PROCESS_CAPTCHA>\n" +
                "   <b:CAPTCHA_CONTENT>Y809S/DZA1.K</b:CAPTCHA_CONTENT>\n" +
                "   <b:CAPTCHA_LOCATION i:nil=\"true\"/>\n" +
                "   <b:CAPTCHA_REQUIRE>公司打码基础上加打\"K\"字符</b:CAPTCHA_REQUIRE>\n" +
                "   <b:DISTRIBUTION_CATEGORY i:nil=\"true\"/>\n" +
                "   <b:FONT i:nil=\"true\"/>\n" +
                "   <b:FONT_SIZE i:nil=\"true\"/>\n" +
                "   <b:IMAGE_PATH>http://10.10.1.196/Attachment//Pictures/打码图1885.PNG</b:IMAGE_PATH>\n" +
                "    <b:ROW_INDEX>0</b:ROW_INDEX>\n" +
                "   <b:UPDATE_VER i:nil=\"true\"/></b:PROCESS_CAPTCHA>\n" +
                "   </a:PROCESS_CAPTCHA>\n" +
                "<a:PROCESS_GUM xmlns:b=\"http://schemas.datacontract.org/2004/07/SIE.PMS.Service.SAP.Processes.OutParams.Processes\">\n" +
                "<b:CAD_FILE_NAME i:nil=\"true\"/>\n" +
                "<b:CCD_IMAGE_NAME i:nil=\"true\"/>\n" +
                "<b:GUM_ATTRIBUTE i:nil=\"true\"/>\n" +
                "<b:GUM_MODE i:nil=\"true\"/>\n" +
                "<b:GUM_TYPE i:nil=\"true\"/>\n" +
                "<b:HEIGHT i:nil=\"true\"/>\n" +
                "<b:IMAGE_PATH/>\n" +
                "<b:IS_DISTRIBUTION>false</b:IS_DISTRIBUTION>\n" +
                "<b:IS_PASTE>false</b:IS_PASTE>\n" +
                "<b:ITEM_CODE/>\n" +
                "<b:ITEM_DESCRIPTION i:nil=\"true\"/>\n" +
                "<b:LENGTH i:nil=\"true\"/>\n" +
                "<b:PASTE_DIRECTION i:nil=\"true\"/>\n" +
                "<b:ROW_INDEX>0</b:ROW_INDEX>\n" +
                "<b:SHAPE i:nil=\"true\"/>\n" +
                "<b:WIDTH i:nil=\"true\"/>\n" +
                "</a:PROCESS_GUM>\n" +
                "<a:PROCESS_LABEL xmlns:b=\"http://schemas.datacontract.org/2004/07/SIE.PMS.Service.SAP.Processes.OutParams.Processes\"><b:PROCESS_LABEL_CONTENT i:nil=\"true\"/><b:PROCESS_LABEL_PRINT i:nil=\"true\"/><b:PROCESS_LABEL_TEMPLATE><b:PROCESS_LABEL_TEMPLATE><b:CARTON_LABEL_TEMPLATE i:nil=\"true\"/><b:CARTON_SEGMENT_INX i:nil=\"true\"/><b:CARTON_SPLIT_CHAR i:nil=\"true\"/><b:IN_LABEL_COLOR i:nil=\"true\"/><b:IN_LABEL_QTY i:nil=\"true\"/><b:IN_LABEL_TEMPLATE>http://10.10.1.196/External//Labels/83537924/InLabel/269897.2//269897.2.jpg</b:IN_LABEL_TEMPLATE><b:IN_SEGMENT_INX i:nil=\"true\"/><b:IN_SPLIT_CHAR i:nil=\"true\"/><b:IS_MATCH_ATTACH_TABLE>false</b:IS_MATCH_ATTACH_TABLE><b:IS_SHOW_LOGO>false</b:IS_SHOW_LOGO><b:OUT_LABEL_QTY i:nil=\"true\"/><b:OUT_LABEL_TEMPLATE i:nil=\"true\"/><b:OUT_SEGMENT_INX i:nil=\"true\"/><b:OUT_SPLIT_CHAR i:nil=\"true\"/><b:SEAL_LABEL_QTY i:nil=\"true\"/><b:SEAL_LABEL_TEMPLATE>http://10.10.1.196/External//Labels/83537924/SealLabel/269898.2//269898.2.jpg</b:SEAL_LABEL_TEMPLATE><b:SEAL_SEGMENT_INX i:nil=\"true\"/><b:SEAL_SPLIT_CHAR i:nil=\"true\"/>\n" +
                "\n" +
                "</b:PROCESS_LABEL_TEMPLATE></b:PROCESS_LABEL_TEMPLATE>\n" +
                "</a:PROCESS_LABEL><a:PROCESS_PACK xmlns:b=\"http://schemas.datacontract.org/2004/07/SIE.PMS.Service.SAP.Processes.OutParams.Processes\"><b:EDGES>去</b:EDGES><b:IS_PASTE_PRODUCT_LABEL>否</b:IS_PASTE_PRODUCT_LABEL><b:MATERIAL_MODE>防静电胶袋：1PCS/包.一片一包，十片一条,再把同型号10条(即100PCS)装同一个密封袋后贴密封袋标签.每种型号用密封袋包装，每个密封袋封口，一个密封袋装不完用第二个等</b:MATERIAL_MODE><b:PACK_MATERIAL_DESC>水晶头704005700008,防静电胶袋706005900019,密封袋706006800022,密封袋706006800003,</b:PACK_MATERIAL_DESC><b:PACK_QTY>1.00</b:PACK_QTY><b:PROCESS_PACK_MATERIAL i:nil=\"true\"/><b:REMARK>芯片与水晶头(水晶头需要全检，检验OK才能包装)分开包装:按订单中芯片型号配送对应型号的水晶头,芯片按此B102标准包装,同型号的水晶头按订单数量装入一个密封袋中(袋子大小要依订单数量选相应尺寸的袋子),最后把各包装好的同一型号的芯片和水晶头再一起装入密封袋中并贴密封袋标签,不是同型号的芯片与水晶头不能混装.</b:REMARK><b:SCOREBOARD>单片</b:SCOREBOARD></a:PROCESS_PACK>\n" +
                "<a:QTB_BASEDATA>\n" +
                "\n" +
                "<a:ACTU_FINISH_DATE>2019/5/24 0:00:00</a:ACTU_FINISH_DATE><a:ATTACH_PCBBOARD_TYPE/><a:CUSTOMER_CODE/><a:CUSTOMER_PRODUCT_CODE/><a:LABEL_SIZE>50.00MM * 32.00MM</a:LABEL_SIZE><a:NEWPCBTEST/><a:PARENT_WO_NO/><a:PROCESS_CODE>U1-PI-CC-B102</a:PROCESS_CODE><a:PROCESS_VERSION>V34</a:PROCESS_VERSION><a:PRODUCT_CODE>701119702692</a:PRODUCT_CODE><a:PRODUCT_DESCRIPTION>S4S2640B-Y809S/DOMDZ-韩国版-三星彩色15K-709水晶头</a:PRODUCT_DESCRIPTION><a:REWORK_CONTENT/><a:REWORK_PALN/><a:SALESMAN/><a:SALE_ORDER_NO/><a:SEMIFINISHED_CODE>702019700071,704005700008</a:SEMIFINISHED_CODE><a:STD_RESULT>标准一致</a:STD_RESULT><a:STD_TITLE/><a:TABLEREMARK>包B102备库存</a:TABLEREMARK><a:WORK_ORDER_NO>83537924</a:WORK_ORDER_NO><a:WORK_ORDER_QTY>200.00</a:WORK_ORDER_QTY><a:WORK_ORDER_TYPE>直通单</a:WORK_ORDER_TYPE>\n" +
                "\n" +
                "</a:QTB_BASEDATA>\n" +
                "</a:QTB_OUT_PARAM>\n" +
                "</QTB_OUT_PARAM>\n" +
                "</QualityTrackBillResponse>\n" +
                "</s:Body>\n" +
                "</s:Envelope>");

    }

    /**
     * 解析xml,返回第一级元素键值对。如果第一级元素有子节点，则此节点的值是子节点的xml数据。
     *
     * @param strxml
     * @return
     * @throws org.jdom2.JDOMException
     * @throws IOException
     */
    public static String doXMLParse(String strxml) throws Exception {
        if (null == strxml || "".equals(strxml)) {
            return null;
        }
        String RJson = "";
        Map hashMap = new HashMap();
        InputStream in = StringInputstream(strxml);
        SAXBuilder builder = new SAXBuilder();
        org.jdom2.Document build = builder.build(in);
        org.jdom2.Element rootElement = build.getRootElement();
        List<org.jdom2.Element> list = rootElement.getChildren();

        Iterator it = list.iterator();
        while (it.hasNext()) {
            org.jdom2.Element e = (org.jdom2.Element) it.next();
            String simpleName = e.getName();
            String v = "";
            List children = e.getChildren();
            if (children.isEmpty()) {
                v = e.getTextNormalize();
            } else {
                v = getChildrenText(children);
            }
            String simpleName2 = null;
            String v2 = "";
            String simpleName3 = null;
            String v3 = "";
            String simpleName4 = null;
            String v4 = "";
            String simpleName5 = null;
            String v5 = "";
            String simpleName6 = null;
            String v6 = "";
            Iterator it2 = children.iterator();
            while (it2.hasNext()) {
                org.jdom2.Element e2 = (org.jdom2.Element) it2.next();
                simpleName2 = e2.getName();
                List children2 = e2.getChildren();
                if (children2.isEmpty()) {
                    v2 = e2.getTextNormalize();
                } else {
                    v2 = getChildrenText(children2);
                }

                Iterator it3 = children2.iterator();
                while (it3.hasNext()) {
                    org.jdom2.Element e3 = (org.jdom2.Element) it3.next();
                    simpleName3 = e3.getName();
                    List children3 = e3.getChildren();
                    if (children3.isEmpty()) {
                        v3 = e3.getTextNormalize();
                    } else {
                        v3 = getChildrenText(children3);
                    }

                    Iterator it4 = children3.iterator();
                    while (it4.hasNext()) {
                        org.jdom2.Element e4 = (org.jdom2.Element) it4.next();
                        simpleName4 = e4.getName();
                        List children4 = e4.getChildren();
                        if (children4.isEmpty()) {
                            v4 = e4.getTextNormalize();
                        } else {
                            v4 = getChildrenText(children4);
                        }
                        for (int i = 0; i < children4.size(); i++) {
                            org.jdom2.Element e5 = (org.jdom2.Element) children4.get(i);
                            String name = e5.getName();
                            List children5 = e5.getChildren();
                            if (children5.isEmpty()) {
                                v5 = e5.getTextNormalize();
                            } else {
                                v5 = getChildrenText(children5);
                            }
                            if (name.equals("PROCESS_CAPTCHA")) {
                                Iterator it6 = children5.iterator();
                                List children6 = null;
                                while (it6.hasNext()) {
                                    org.jdom2.Element e6 = (org.jdom2.Element) it6.next();
                                    simpleName6 = e6.getName();
                                    children6 = e6.getChildren();
                                    if (children6.isEmpty()) {
                                        v6 = e6.getTextNormalize();
                                    } else {
                                        v6 = getChildrenText(children6);
                                    }
                                }
                                Iterator it7 = children6.iterator();
                                while (it7.hasNext()) {
                                    org.jdom2.Element e7 = (org.jdom2.Element) it7.next();
                                    System.out.println(e7.getValue() + "");

                                    if (e7.getName().equals("CAPTCHA_CONTENT")) {
                                        hashMap.put("CAPTCHA_CONTENT", e7.getValue());
                                    } else if (e7.getName().equals("CAPTCHA_LOCATION2")) {
                                        hashMap.put("CAPTCHA_LOCATION2", e7.getValue());
                                    } else if (e7.getName().equals("CAPTCHA_LOCATION3")) {
                                        hashMap.put("CAPTCHA_LOCATION3", e7.getValue());
                                    } else if (e7.getName().equals("CAPTCHA_LOCATION4")) {
                                        hashMap.put("CAPTCHA_LOCATION4", e7.getValue());
                                    } else if (e7.getName().equals("CAPTCHA_LOCATION")) {
                                        hashMap.put("CAPTCHA_LOCATION", e7.getValue());
                                    } else if (e7.getName().equals("CAPTCHA_REQUIRE")) {
                                        hashMap.put("CAPTCHA_REQUIRE", e7.getValue());
                                    } else if (e7.getName().equals("DISTRIBUTION_CATEGORY")) {
                                        hashMap.put("DISTRIBUTION_CATEGORY", e7.getValue());
                                    } else if (e7.getName().equals("FONT")) {
                                        hashMap.put("FONT", e7.getValue());
                                    } else if (e7.getName().equals("FONT_SIZE")) {
                                        hashMap.put("FONT_SIZE", e7.getValue());
                                    } else if (e7.getName().equals("IMAGE_PATH")) {
                                        System.out.println("*************" + e7.getValue());
                                        hashMap.put("IMAGE_PATH", e7.getValue().toString());
                                    } else if (e7.getName().equals("ROW_INDEX")) {
                                        hashMap.put("T_ROW_INDEX", e7.getValue());
                                    } else if (e7.getName().equals("ROW_INDEX2")) {
                                        hashMap.put("T_ROW_INDEX2", e7.getValue());
                                    } else if (e7.getName().equals("UPDATE_VER")) {
                                        hashMap.put("UPDATE_VER", e7.getValue());
                                    }

                                }
                            } else if (name.equals("PROCESS_GUM")) {

                                for (int j = 0; j < children5.size(); j++) {
                                    org.jdom2.Element e6 = (org.jdom2.Element) children5.get(j);

                                    if (e6.getName().equals("CAD_FILE_NAME")) {
                                        hashMap.put("CAD_FILE_NAME", e6.getValue());
                                    } else if (e6.getName().equals("CCD_IMAGE_NAME")) {
                                        hashMap.put("CCD_IMAGE_NAME", e6.getValue());
                                    } else if (e6.getName().equals("GUM_ATTRIBUTE")) {
                                        hashMap.put("GUM_ATTRIBUTE", e6.getValue());
                                    } else if (e6.getName().equals("GUM_MODE")) {
                                        hashMap.put("GUM_MODE", e6.getValue());
                                    } else if (e6.getName().equals("GUM_TYPE")) {
                                        hashMap.put("GUM_TYPE", e6.getValue());
                                    } else if (e6.getName().equals("IMAGE_PATH")) {
                                        hashMap.put("IMAGE_PATH", e6.getValue().toString());
                                    } else if (e6.getName().equals("IS_DISTRIBUTION")) {
                                        System.out.println(e6.getValue() + "nihao");
                                        hashMap.put("IS_DISTRIBUTION", e6.getValue());
                                    } else if (e6.getName().equals("IS_PASTE")) {
                                        System.out.println(e6.getValue() + "nihao");
                                        hashMap.put("IS_PASTE", e6.getValue());
                                    } else if (e6.getName().equals("ITEM_CODE")) {
                                        hashMap.put("ITEM_CODE", e6.getValue());
                                    } else if (e6.getName().equals("ITEM_DESCRIPTION")) {
                                        hashMap.put("ITEM_DESCRIPTION", e6.getValue());
                                    } else if (e6.getName().equals("LENGTH")) {
                                        hashMap.put("LENGTH", e6.getValue());
                                    } else if (e6.getName().equals("PASTE_DIRECTION")) {
                                        hashMap.put("PASTE_DIRECTION", e6.getValue());
                                    } else if (e6.getName().equals("ROW_INDEX")) {
                                        hashMap.put("M_ROW_INDEX", e6.getValue());
                                    } else if (e6.getName().equals("ROW_INDEX2")) {
                                        hashMap.put("M_ROW_INDEX2", e6.getValue());
                                    } else if (e6.getName().equals("SHAPE")) {
                                        hashMap.put("SHAPE", e6.getValue());
                                    } else if (e6.getName().equals("WIDTH")) {
                                        hashMap.put("WIDTH", e6.getValue());
                                    }

                            }
                        } else if (name.equals("PROCESS_PACK")) {
                            Iterator it6 = children5.iterator();
                            while (it6.hasNext()) {
                                org.jdom2.Element e6 = (org.jdom2.Element) it6.next();
                                if (e6.getName().equals("EDGES")) {
                                    hashMap.put("EDGES", e6.getValue());
                                } else if (e6.getName().equals("IS_PASTE_PRODUCT_LABEL")) {
                                    hashMap.put("IS_PASTE_PRODUCT_LABEL", e6.getValue());
                                } else if (e6.getName().equals("MATERIAL_MODE")) {
                                    hashMap.put("MATERIAL_MODE", e6.getValue());
                                } else if (e6.getName().equals("PACK_MATERIAL_DESC")) {
                                    hashMap.put("PACK_MATERIAL_DESC", e6.getValue());
                                } else if (e6.getName().equals("PACK_QTY")) {
                                    hashMap.put("PACK_QTY", e6.getValue());
                                } else if (e6.getName().equals("PROCESS_PACK_MATERIAL")) {
                                    hashMap.put("PROCESS_PACK_MATERIAL", e6.getValue());
                                } else if (e6.getName().equals("REMARK")) {
                                    hashMap.put("REMARK", e6.getValue());
                                } else if (e6.getName().equals("SCOREBOARD")) {
                                    hashMap.put("SCOREBOARD", e6.getValue());
                                }
                            }

                        } else if (name.equals("QTB_BASEDATA")) {
                            Iterator it6 = children5.iterator();
                            while (it6.hasNext()) {
                                org.jdom2.Element e6 = (org.jdom2.Element) it6.next();
                                if (e6.getName().equals("ACTU_FINISH_DATE")) {
                                    hashMap.put("ACTU_FINISH_DATE", e6.getValue());
                                } else if (e6.getName().equals("ATTACH_PCBBOARD_TYPE")) {
                                    hashMap.put("ATTACH_PCBBOARD_TYPE", e6.getValue());
                                } else if (e6.getName().equals("CUSTOMER_CODE")) {
                                    hashMap.put("CUSTOMER_CODE", e6.getValue());
                                } else if (e6.getName().equals("CUSTOMER_PRODUCT_CODE")) {
                                    hashMap.put("CUSTOMER_PRODUCT_CODE", e6.getValue());
                                } else if (e6.getName().equals("LABEL_SIZE")) {
                                    hashMap.put("LABEL_SIZE", e6.getValue());
                                } else if (e6.getName().equals("NEWPCBTEST")) {
                                    hashMap.put("NEWPCBTEST", e6.getValue());
                                } else if (e6.getName().equals("PARENT_WO_NO")) {
                                    hashMap.put("PARENT_WO_NO", e6.getValue());
                                } else if (e6.getName().equals("PROCESS_CODE")) {
                                    hashMap.put("PROCESS_CODE", e6.getValue());
                                } else if (e6.getName().equals("PROCESS_VERSION")) {
                                    hashMap.put("PROCESS_VERSION", e6.getValue());
                                } else if (e6.getName().equals("PRODUCT_CODE")) {
                                    hashMap.put("PRODUCT_CODE", e6.getValue());
                                } else if (e6.getName().equals("PRODUCT_DESCRIPTION")) {
                                    hashMap.put("PRODUCT_DESCRIPTION", e6.getValue());
                                } else if (e6.getName().equals("REWORK_CONTENT")) {
                                    hashMap.put("REWORK_CONTENT", e6.getValue());
                                } else if (e6.getName().equals("REWORK_PALN")) {
                                    hashMap.put("REWORK_PALN", e6.getValue());
                                } else if (e6.getName().equals("SALESMAN")) {
                                    hashMap.put("SALESMAN", e6.getValue());
                                } else if (e6.getName().equals("SALE_ORDER_NO")) {
                                    hashMap.put("SALE_ORDER_NO", e6.getValue());
                                } else if (e6.getName().equals("SEMIFINISHED_CODE")) {
                                    hashMap.put("SEMIFINISHED_CODE", e6.getValue());
                                } else if (e6.getName().equals("STD_RESULT")) {
                                    hashMap.put("STD_RESULT", e6.getValue());
                                } else if (e6.getName().equals("STD_TITLE")) {
                                    hashMap.put("STD_TITLE", e6.getValue());
                                } else if (e6.getName().equals("TABLEREMARK")) {
                                    hashMap.put("TABLEREMARK", e6.getValue());
                                } else if (e6.getName().equals("WORK_ORDER_NO")) {
                                    hashMap.put("WORK_ORDER_NO", e6.getValue());
                                } else if (e6.getName().equals("WORK_ORDER_QTY")) {
                                    hashMap.put("WORK_ORDER_QTY", e6.getValue());
                                } else if (e6.getName().equals("WORK_ORDER_TYPE")) {
                                    hashMap.put("WORK_ORDER_TYPE", e6.getValue());
                                }
                            }

                        } else if (name.equals("PROCESS_LABEL")) {

                            for (int j = 0; j < children5.size(); j++) {
                                org.jdom2.Element e8 = (org.jdom2.Element) children5.get(i);
                                String namess = e8.getName();
                                List children8 = e8.getChildren();
                                if (namess.equals("PROCESS_LABEL_TEMPLATE")) {
                                    Iterator it9 = children8.iterator();
                                    List children9 = null;
                                    while (it9.hasNext()) {
                                        org.jdom2.Element e9 = (org.jdom2.Element) it9.next();
//                                            simpleName9 = e9.getName();
                                        children9 = e9.getChildren();
//                                            if (children6.isEmpty()) {
//                                                v6 = e6.getTextNormalize();
//                                            } else {
//                                                v6 = getChildrenText(children6);
//                                            }
                                    }
                                    Iterator it10 = children9.iterator();
                                    while (it10.hasNext()) {
                                        org.jdom2.Element e10 = (org.jdom2.Element) it10.next();
                                        System.out.println(e10.getValue() + "");
                                        if (e10.getName().equals("CARTON_LABEL_TEMPLATE")) {
                                            hashMap.put("CARTON_LABEL_TEMPLATE", e10.getValue());
                                        } else if (e10.getName().equals("CARTON_SEGMENT_INX")) {
                                            hashMap.put("CARTON_SEGMENT_INX", e10.getValue());
                                        } else if (e10.getName().equals("CARTON_SPLIT_CHAR")) {
                                            hashMap.put("CARTON_SPLIT_CHAR", e10.getValue());
                                        } else if (e10.getName().equals("IN_LABEL_COLOR")) {
                                            hashMap.put("IN_LABEL_COLOR", e10.getValue());
                                        } else if (e10.getName().equals("IN_LABEL_QTY")) {
                                            hashMap.put("IN_LABEL_QTY", e10.getValue());
                                        } else if (e10.getName().equals("IN_LABEL_TEMPLATE")) {
                                            hashMap.put("IN_LABEL_TEMPLATE", e10.getValue());
                                        } else if (e10.getName().equals("IN_SEGMENT_INX")) {
                                            hashMap.put("IN_SEGMENT_INX", e10.getValue());
                                        } else if (e10.getName().equals("IN_SPLIT_CHAR")) {
                                            hashMap.put("IN_SPLIT_CHAR", e10.getValue());
                                        } else if (e10.getName().equals("IS_MATCH_ATTACH_TABLE")) {
                                            hashMap.put("IS_MATCH_ATTACH_TABLE", e10.getValue());
                                        } else if (e10.getName().equals("IS_SHOW_LOGO")) {
                                            hashMap.put("IS_SHOW_LOGO", e10.getValue());
                                        } else if (e10.getName().equals("OUT_LABEL_QTY")) {
                                            hashMap.put("OUT_LABEL_QTY", e10.getValue());
                                        } else if (e10.getName().equals("OUT_LABEL_TEMPLATE")) {
                                            hashMap.put("OUT_LABEL_TEMPLATE", e10.getValue());
                                        } else if (e10.getName().equals("OUT_SEGMENT_INX")) {
                                            hashMap.put("OUT_SEGMENT_INX", e10.getValue());
                                        } else if (e10.getName().equals("OUT_SPLIT_CHAR")) {
                                            hashMap.put("OUT_SPLIT_CHAR", e10.getValue());
                                        } else if (e10.getName().equals("SEAL_LABEL_QTY")) {
                                            hashMap.put("SEAL_LABEL_QTY", e10.getValue());
                                        } else if (e10.getName().equals("SEAL_LABEL_TEMPLATE")) {
                                            hashMap.put("SEAL_LABEL_TEMPLATE", e10.getValue());
                                        } else if (e10.getName().equals("SEAL_SEGMENT_INX")) {
                                            hashMap.put("SEAL_SEGMENT_INX", e10.getValue().toString());
                                        } else if (e10.getName().equals("SEAL_SPLIT_CHAR")) {
                                            hashMap.put("SEAL_SPLIT_CHAR", e10.getValue().toString());
                                        }
                                    }
                                }
                            }
                        }
                        System.out.println(v5 + "**************" + i);
                    }
                }
            }
        }
    }
    //关闭流
        in.close();
    JSONObject object = new JSONObject(hashMap);
    QualityCard qualityCard = new QualityCard();

        qualityCard.setOrderitemcode(object.get("PRODUCT_CODE").

    toString());
        qualityCard.setWoSaleOrderNo(object.get("WORK_ORDER_NO").

    toString());//订单号
        qualityCard.setItemDescription(object.get("PRODUCT_DESCRIPTION").

    toString());
        qualityCard.setItemCode(object.get("ITEM_CODE").

    toString());
        qualityCard.setWoMergeParentNo(object.get("PARENT_WO_NO").

    toString());

//        qualityCard.setWoNo();//直通单
        qualityCard.setCustomercode(object.get("CUSTOMER_CODE").

    toString());
        qualityCard.setPackcode(object.get("TABLEREMARK").

    toString());
        qualityCard.setCustomerProductCode(object.get("CUSTOMER_PRODUCT_CODE").

    toString());
    DateFormat fmt = new SimpleDateFormat("yyyy/MM/dd ");
    Date date = fmt.parse(object.get("ACTU_FINISH_DATE").toString());
        qualityCard.setWoActuFinishDate(date);

        qualityCard.setPmsQuotationBezei1(object.get("SALESMAN").

    toString());
        qualityCard.setCaptcharequire(object.get("CAPTCHA_REQUIRE").

    toString());
        qualityCard.setCaptchacontent(object.get("CAPTCHA_CONTENT").

    toString());
        qualityCard.setCaptchacontent2(object.get("CAPTCHA_CONTENT2").

    toString());//打码内容
        qualityCard.setCaptchacontent3(object.get("CAPTCHA_CONTENT3").

    toString());

        qualityCard.setCaptchacontent4(object.get("CAPTCHA_CONTENT4").

    toString());
        qualityCard.setImagefullname(object.get("IMAGE_PATH").

    toString());
//        long l = Long.valueOf("123").longValue();
        qualityCard.setRowindex(Long.valueOf(object.get("T_ROW_INDEX").

    toString()).

    longValue());
        qualityCard.setRowindex2(Long.valueOf(object.get("M_ROW_INDEX").

    toString()).

    longValue());
        qualityCard.setRowindex3(Long.valueOf(object.get("T_ROW_INDEX2").

    toString()).

    longValue());//行号

        qualityCard.setRowindex4(Long.valueOf(object.get("M_ROW_INDEX2").

    toString()).

    longValue());
        qualityCard.setWorkshoppackmode(object.get("MATERIAL_MODE").

    toString());//包装方式
        qualityCard.setPackitemcategoryItemcode(object.get("PROCESS_PACK_MATERIAL").

    toString());//PACKITEMCATEGORY + ITEMCODE
        qualityCard.setPackmaterialscoreboard(object.get("SCOREBOARD").

    toString());
        qualityCard.setPackmaterialedges(object.get("EDGES").

    toString());

    String pack_qty = object.get("PACK_QTY").toString();
    String str1 = pack_qty.substring(0, pack_qty.indexOf("."));
        qualityCard.setInlabelqty(Long.valueOf(str1).

    longValue());
        System.out.println(object.get("IS_PASTE").

    toString()+"hh");
        qualityCard.setIspaste(object.get("IS_PASTE").

    toString());
        qualityCard.setNewpcbtest(object.get("NEWPCBTEST").

    toString());
        qualityCard.setIsdistribution(object.get("IS_DISTRIBUTION").

    toString());
        qualityCard.setItemcode(object.get("ITEM_CODE").

    toString());
        qualityCard.setImagePath(object.get("IMAGE_PATH").

    toString());
        qualityCard.setInlabeltemplate(object.get("IN_LABEL_TEMPLATE").

    toString());

        qualityCard.setOutlabeltemplate(object.get("OUT_LABEL_TEMPLATE").

    toString());
        qualityCard.setSeallabeltemplate(object.get("SEAL_LABEL_TEMPLATE").

    toString());
        qualityCard.setBoxlabeltemplate(object.get("CARTON_LABEL_TEMPLATE").

    toString());
        qualityCard.setProcesscode(object.get("PROCESS_CODE").

    toString());
        qualityCard.setProcessversion(object.get("PROCESS_VERSION").

    toString());

        qualityCard.setIsPasteProductLabel(object.get("IS_PASTE_PRODUCT_LABEL").

    toString());
        qualityCard.setAttachPcbboardType(object.get("ATTACH_PCBBOARD_TYPE").

    toString());
//        qualityCard.setRemark(object.get("REMARK").toString());

        System.out.println(object +"^^^^^^^^^^^^^^");
        return object.toString();
}

    /**
     * 获取子结点的xml
     *
     * @param children
     * @return String
     */
    public static String getChildrenText(List children) {
        StringBuffer sb = new StringBuffer();
        if (!children.isEmpty()) {
            Iterator it = children.iterator();
            while (it.hasNext()) {
                org.jdom2.Element e = (org.jdom2.Element) it.next();
                String name = e.getName();
                String value = e.getTextNormalize();
                List list = e.getChildren();
                sb.append("<" + name + ">");
                if (!list.isEmpty()) {
                    sb.append(getChildrenText(list));
                }
                sb.append(value);
                sb.append("</" + name + ">");
            }
        }
        return sb.toString();
    }

    public static InputStream StringInputstream(String str) {
        return new ByteArrayInputStream(str.getBytes());
    }

}
